import { Exclude } from 'class-transformer';
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('shop_users')
export class ShopUsersEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ length: 50, comment: '用户名' })
  username: string;

  @Exclude({ toPlainOnly: true })
  @Column({ length: 255, comment: '密码' })
  password: string;

  @Column({ length: 20, comment: '手机号', nullable: true })
  phone: string;

  @Column({ length: 100, comment: '邮箱', nullable: true })
  email: string;

  @CreateDateColumn({ type: 'timestamp', comment: '创建时间' })
  createTime: Date;
}
